home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD School House 10
/
CD School House - Education and Games (10.0) - Wayzata Technology (1995).iso
/
mac
/
DOS
/
MISC
/
FTK
/
LINREG.TK
< prev
next >
Wrap
Text File
|
1994-02-24
|
3KB
|
322 lines
TK!2
=v
#1
:n
X
:v
5
:s
i
:c
given X
#2
:n
Y
:s
b
:c
predicted Y
#3
:n
dY
:s
b
:c
tolerance of predicted y
#4
:n
a
:s
b
:c
intercept in Y = a + b*X
#5
:n
b
:s
b
:c
slope in Y = a + b*X
#6
:n
t
:v
2.447
:s
i
:c
t-value = f(confidence level,n-2 dof)
#7
:n
xav
:s
b
:c
average x value
#8
:n
yav
:s
b
:c
average y value
#9
:n
SXX
:s
b
:c
sum of squares of x's
#10
:n
SYY
:s
b
:c
sum of squares of y's
#11
:n
SXY
:s
b
:c
sum of cross products
#12
:n
SSR
:s
b
:c
sum of squares due to regression
#13
:n
rXY
:s
b
:c
correlation coefficient
#14
:n
RMS
:s
b
:c
residual mean square
#15
:n
SER
:s
b
:c
standard error of regression
#16
:n
n
:v
8
:s
i
:c
number of observations
#17
:n
x1
:v
2.4
:s
i
:c
data
#18
:n
x2
:v
3.7
:s
i
:c
" Note: When n < 8 , 8-n pairs of
#19
:n
x3
:v
4.3
:s
i
:c
" xi,yi must be assigned 0.
#20
:n
x4
:v
5.5
:s
i
:c
"
#21
:n
x5
:v
6
:s
i
:c
" There are no limits on number of
#22
:n
x6
:v
6.1
:s
i
:c
" observations in TK Solver Plus
#23
:n
x7
:v
7.6
:s
i
:c
" (except for computer memory)
#24
:n
x8
:v
8.1
:s
i
:c
"
#25
:n
y1
:v
3.5
:s
i
:c
"
#26
:n
y2
:v
3.7
:s
i
:c
"
#27
:n
y3
:v
4.2
:s
i
:c
"
#28
:n
y4
:v
4.4
:s
i
:c
"
#29
:n
y5
:v
4.7
:s
i
:c
"
#30
:n
y6
:v
5.2
:s
i
:c
"
#31
:n
y7
:v
5.3
:s
i
:c
"
#32
:n
y8
:v
6.1
:s
i
:c
"
=u
=r
#1
:r
xav = sum(x1,x2,x3,x4,x5,x6,x7,x8)/n " *** Regression Analysis ***
#2
:r
yav = sum(y1,y2,y3,y4,y5,y6,y7,y8)/n
#3
:r
SXX = sum(x1^2,x2^2,x3^2,x4^2,x5^2,x6^2,x7^2,x8^2) - n*xav^2
#4
:r
SYY = sum(y1^2,y2^2,y3^2,y4^2,y5^2,y6^2,y7^2,y8^2) - n*yav^2
#5
:r
SXY = sum(x1*y1,x2*y2,x3*y3,x4*y4,x5*y5,x6*y6,x7*y7,x8*y8) - n*xav*yav
#6
:r
b = SXY/SXX " - - - - - - - - - - - - - - - - - - - - - - - - - -
#7
:r
yav = a + b*xav " One advantage of using TK for statistical analysis
#8
:r
" and especially for curve fitting is the ease of
:s
C
#9
:r
SSR = SXX*b^2 " alternating between analysis and prediction. Here
#10
:r
rXY^2 = SSR/SYY " the calculated values of regression coefficients
#11
:r
RMS = (SYY-SSR)/(n-2) " were used to find Y at X=5. In TK Solver Plus with
#12
:r
SER^2 = RMS " lists, procedures, graphics, etc., the statistical
#13
:r
" models are more elegant, powerful and easy to use.
:s
C
#14
:r
" - - - - - - - - - - - - - - - - - - - - - - - - - -
:s
C
#15
:r
Y = a + b*X " *** P r e d i c t i o n ***
#16
:r
dY = t * sqrt(RMS*(1+1/n+(X-xav)^2/SXX)) " (based on analysis)
%Tr,f,0,1,0,1,0